package com.dkt.android.mvp.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.VirtualLayoutManager
import com.dkt.android.R
import com.dkt.android.base.BaseFragment
import com.dkt.android.core.RouterHub

@Route(path = RouterHub.APP_ORDER)
class OrderFragment : BaseFragment(){

    private var mainAdapter: DelegateAdapter? = null

    override fun onCreateView(
            inflater: LayoutInflater, container: ViewGroup?,
            savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.public_base_ry, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        initData()
        initView(view)

    }

    private fun initData(){

    }

    private fun initView(view: View){
        val layoutManager = VirtualLayoutManager(this@OrderFragment.activity!!)
        val baseRy = view.findViewById<RecyclerView>(R.id.baseRy)
        mainAdapter = DelegateAdapter(layoutManager, false)
        baseRy?.layoutManager = layoutManager
        baseRy?.adapter = mainAdapter
    }
}